texture_lod
Specification
Name
SGIS_texture_lod
Name Strings
GL_SGIS_texture_lod
Version
$Date: 1996/09/09 01:00:16 $ $Revision: 1.2 $
Number
24
Dependencies
EXT_texture is required
EXT_texture3D affects the definition of this extension
EXT_texture_object affects the definition of this extension
SGI_detail_texture affects the definition of this extension
SGI_sharpen_texture affects the definition of this extension
Overview
This extension imposes two constraints related to the texture level of
detail parameter LOD, which is represented by the Greek character lambda
in the GL Specification. One constraint clamps LOD to a specified
floating point range. The other limits the selection of mipmap image
arrays to a subset of the arrays that would otherwise be considered.
Together these constraints allow a large texture to be loaded and
used initially at low resolution, and to have its resolution raised
gradually as more resolution is desired or available. Image array
specification is necessarily integral, rather than continuous. By
providing separate, continuous clamping of the LOD parameter, it is
possible to avoid "popping" artifacts when higher resolution images
are provided.
Issues
* Should detail and sharpen texture operate when the level 0 image
is not being used?
New Procedures and Functions
None
New Tokens
Accepted by the < pname > parameter of TexParameteri, TexParameterf,
TexParameteriv, TexParameterfv, GetTexParameteriv, and GetTexParameterfv:
TEXTURE_MIN_LOD_SGIS
TEXTURE_MAX_LOD_SGIS
TEXTURE_BASE_LEVEL_SGIS
TEXTURE_MAX_LEVEL_SGIS
Additions to Chapter 2 of the 1.0 Specification (OpenGL Operation)
None
Additions to Chapter 3 of the 1.0 Specification (Rasterization)
GL Specification Table 3.7 is updated as follows:
Name Type Legal Values
---- ---- ------------
TEXTURE_WRAP_S integer CLAMP, REPEAT
TEXTURE_WRAP_T integer CLAMP, REPEAT
TEXTURE_WRAP_R_EXT integer CLAMP, REPEAT
TEXTURE_MIN_FILTER integer NEAREST, LINEAR,
NEAREST_MIPMAP_NEAREST,
NEAREST_MIPMAP_LINEAR,
LINEAR_MIPMAP_NEAREST,
LINEAR_MIPMAP_LINEAR,
FILTER4_SGIS
TEXTURE_MAG_FILTER integer NEAREST, LINEAR,
FILTER4_SGIS,
LINEAR_DETAIL_SGIS,
LINEAR_DETAIL_ALPHA_SGIS,
LINEAR_DETAIL_COLOR_SGIS,
LINEAR_SHARPEN_SGIS,
LINEAR_SHARPEN_ALPHA_SGIS,
LINEAR_SHARPEN_COLOR_SGIS
TEXTURE_BORDER_COLOR 4 floats any 4 values in [0,1]
DETAIL_TEXTURE_LEVEL_SGIS integer any non-negative integer
DETAIL_TEXTURE_MODE_SGIS integer ADD, MODULATE
TEXTURE_MIN_LOD_SGIS float any value
TEXTURE_MAX_LOD_SGIS float any value
TEXTURE_BASE_LEVEL_SGIS integer any non-negative integer
TEXTURE_MAX_LEVEL_SGIS integer any non-negative integer
Table 3.7: Texture parameters and their values.
Level of Detail Clamping
------------------------
The level of detail parameter LOD is defined in the first paragraph
of Section 3.8.1 (Texture Minification) of the GL Specification, where
it is represented by the Greek character lambda. This extension
redefines the definition of LOD as follows:
LOD'(x,y) = log_base_2 (P(x,y))
/ MAX_LOD LOD' > MAX_LOD
LOD = ( LOD' LOD' >= MIN_LOD and LOD' <= MAX_LOD
\ MIN_LOD LOD' < MIN_LOD
\ undefined MIN_LOD > MAX_LOD
The variable P in this definition represents the Greek character rho,
as it is used in the OpenGL Specification. MIN_LOD is the value of
the per-texture variable TEXTURE_MIN_LOD_SGIS, and MAX_LOD is the value
of the per-texture variable TEXTURE_MAX_LOD_SGIS.
By default TEXTURE_MIN_LOD_SGIS and TEXTURE_MAX_LOD_SGIS are -1000 and
1000 respectively, so they do not interfere with the normal operation of
texture mapping. These values are respecified for a specific texture
by calling TexParameteri, TexParemeterf, TexParameteriv, or
TexParameterfv with < target > set to TEXTURE_1D, TEXTURE_2D, or
TEXTURE_3D_EXT, < pname > set to TEXTURE_MIN_LOD_SGIS or
TEXTURE_MAX_LOD_SGIS, and < param > set to (or < params > pointing to) the
new value. It is not an error to specify a maximum LOD value that is
less than the minimum LOD value, but the resulting LOD values are
not defined.
LOD is clamped to the specified range prior to any use. Specifically,
the mipmap image array selection described in the Mipmapping Subsection
of the GL Specification is based on the clamped LOD value. Also, the
determination of whether the minification or magnification filter is
used is based on the clamped LOD.
Image Array Availability
------------------------
The GL Specification describes a "complete" set of mipmap image arrays
as array levels 0 through p, where p is a well defined function of the
dimensions of the level 0 image. Thus the level 0 image is the base of
a set of image arrays. This extension allows any image level to be
redefined as the base level. The base level is specified by calling
TexParameteri, TexParemeterf, TexParameteriv, or TexParameterfv with
< target > set to TEXTURE_1D, TEXTURE_2D, or TEXTURE_3D_EXT, < pname > set
to TEXTURE_BASE_LEVEL_SGIS, and < param > set to (or < params > pointing to)
the desired value. The error INVALID_VALUE is generated if the
specified base level is negative.
The discussion of array completeness in the GL Specification is
unchanged, understanding that the "first" array is the the array at the
base level. The u, v, and w coordinates used to compute rho are
those of the base level array, rather than those of array level 0,
thus the resulting LOD values are relative to the base level array.
Mipmap selection is also relative to the base level array, so the dth
mipmap array is selected when
(d - 1/2) < (LOD + BASE_LEVEL) <= (d + 1/2)
And magnification, when selected, is performed on the base level array.
Sharpen filters (described in SGIS_sharpen_texture) operate on array
levels BASE_LEVEL and BASE_LEVEL+1. Detail filters (described in
SGIS_detail_texture) operate only when the BASE_LEVEL is zero.
It is also possible to truncate the set of mipmap image arrays by
specifying a maximum image level. The maximum level is specified by
calling TexParameteri, TexParemeterf, TexParameteriv, or TexParameterfv
with < target > set to TEXTURE_1D, TEXTURE_2D, or TEXTURE_3D_EXT, < pname >
set to TEXTURE_MAX_LEVEL_SGIS, and < param > set to (or < params > pointing
to) the desired value. The error INVALID_VALUE is generated if the
specified maximum level is negative.
The maximum level is significant only when it is less than p, as
described above. In this case the set of mipmap image arrays is
complete if levels BASE_LEVEL through MAX_LEVEL conform to the
completeness requirements. Image levels less than BASE_LEVEL and
image levels greater than MAX_LEVEL are never accessed, and they have
no effect on the completeness of the mipmap array.
If a maximum level less than p is specified, the GL will limit its
computed value of LOD so that no attempt is ever made to access an
image array at a level greater than MAX_LEVEL. For the texture
minification filters that are currently defined, the limits are:
Filter Maximum LOD
------ -----------
NEAREST none
LINEAR none
NEAREST_MIPMAP_NEAREST MAX_LEVEL + 0.5
LINEAR_MIPMAP_NEAREST MAX_LEVEL + 0.5
NEAREST_MIPMAP_LINEAR MAX_LEVEL
LINEAR_MIPMAP_LINEAR MAX_LEVEL
FILTER4_SGIS none
LOD is limited to the minimum of the table value (above) and MAX_LOD,
as specified by the application.
Additions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations
and the Frame Buffer)
None
Additions to Chapter 5 of the 1.0 Specification (Special Functions)
None
Additions to Chapter 6 of the 1.0 Specification (State and State Requests)
None
Additions to the GLX Specification
None
Dependencies on EXT_texture
EXT_texture is required.
Dependencies on EXT_texture3D
If EXT_texture3D is not supported, references to 3D texture mapping and
to TEXTURE_3D_EXT in this document are invalid and should be ignored.
Dependencies on EXT_texture_object
If EXT_texture_object is implemented, the state values named
TEXTURE_MIN_LOD_SGIS
TEXTURE_MAX_LOD_SGIS
TEXTURE_BASE_LEVEL_SGIS
TEXTURE_MAX_LEVEL_SGIS
are added to the state vector of each texture object. When an attribute
set that includes texture information is popped, the bindings and
enables are first restored to their pushed values, then the bound
textures have their LOD and LEVEL parameters restored to their pushed
values.
Dependencies on SGIS_detail_texture
If SGIS_detail_texture is not supported, references to detail texture
mapping in this document are invalid and should be ignored.
Dependencies on SGIS_sharpen_texture
If SGIS_sharpen_texture is not supported, references to sharpen texture
mapping in this document are invalid and should be ignored.
Errors
INVALID_VALUE is generated if an attempt is made to set
TEXTURE_BASE_LEVEL_SGIS or TEXTURE_MAX_LEVEL_SGIS to a negative value.
New State
Initial
Get Value Get Command Type Value Attrib
--------- ----------- ---- ------- ------
TEXTURE_MIN_LOD_SGIS GetTexParameterfv n x R -1000 texture
TEXTURE_MAX_LOD_SGIS GetTexParameterfv n x R 1000 texture
TEXTURE_BASE_LEVEL_SGIS GetTexParameteriv n x R 0 texture
TEXTURE_MAX_LEVEL_SGIS GetTexParameteriv n x R 1000 texture
New Implementation Dependent State
None